<template>
<div>
  <el-row class="tac">
    <el-col :span="24">
      <h5>图书分类</h5>
      <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose">
        <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>分类</span>
          </template>
          <el-menu-item-group>
            <template slot="title">价格</template>
            <el-menu-item index="1-1">便宜</el-menu-item>
            <el-menu-item index="1-2">奢侈</el-menu-item>
          </el-menu-item-group>
          <el-menu-item-group title="图书类别">
            <el-menu-item index="1-3">工科</el-menu-item>
            <el-menu-item index="1-4">理科</el-menu-item>
            <el-menu-item index="1-5">文史</el-menu-item>
            <el-menu-item index="1-6">考研</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
      </el-menu>
    </el-col>
  </el-row>
</div>
</template>

<script>
export default {
  name: "Nav",
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  }
}
</script>

<style scoped>

</style>